@extends('layout.app') @section('content')

    <div class="box-body">

        <table id="rowed3"></table>
        <div id="prowed3"></div>

    </div>

    <script>
        $(document).ready(function() {

            var data = {
                url: "/user/tihuo",
                colNames: ['id' , '申请时间' , '用户Id' , '昵称' , '商品名称' , '数量' , '姓名' , '电话' , '省' , '市' , '区' , '详细地址' , '状态' , '备注'],
                colModel: [{
                    name  : 'id',
                    key   : true,
                    hidden: true
                },{
                    name: 'time',
                    formatter:'date',
                    formatoptions: {srcformat: 'Y-m-d H:i:s', newformat: 'Y-m-d H:i:s'},
                    searchoptions: {
                        sopt: ['lt', 'le', 'gt', 'ge'],
                        dataInit : function (elem) {
                            $(elem).datepicker({
                                dateFormat: 'yy-mm-dd',
                                monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
                                dayNamesMin: ['日','一','二','三','四','五','六'] });
                        }
                    }
                }, {
                    name: 'user_id'
                }, {
                    name: 'nickname',
                    sortable: false
                }, {
                    name: 'goods_name',
                    sortable: false
                }, {
                    name: 'num'
                }, {
                    name: 'receive_name',
                    sortable: false
                }, {
                    name: 'phone',
                    sortable: false
                }, {
                    name: 'province',
                    sortable: false
                }, {
                    name: 'city',
                    sortable: false
                }, {
                    name: 'district',
                    sortable: false
                }, {
                    name: 'detail',
                    sortable: false,
                    search: false
                }, {
                    name: 'status',
                    editable: true,
                    stype: 'select',
                    searchoptions: {
                        sopt: ["eq", "ne"],
                        value: "0:申请;1:已发货;2:已充值"
                    },
                    edittype: 'select',
                    editoptions: {
                        value: '0:申请;1:<span class="text-success">已发货</span>;2:<span class="text-success">已充值</span>'
                    },
                    formatter: function(cellvalue) {
                        cellvalue = cellvalue.toString();
                        switch (cellvalue) {
                            case "0":
                                return "申请";
                            case "1":
                                return '<span class="text-success">已发货</span>';
                            case "2":
                                return '<span class="text-success">已充值</span>';
                        }
                        return cellvalue;
                    }
                }, {
                    name: 'desc',
                    sortable: false,
                    search: false,
                    editable: true,
                    edittype: 'textarea',
                    editable: true,
                    editoptions: {
                        rows: "3",
                        cols: "30"
                    }
                }],
                caption: '<i class="fa fa-table"></i> {{$label2}}',
                editurl: "/user/tihuo/edit",
                sortname: 'id',
                sortorder: "desc"
            };

            jqGrid(data, true, false, true);
        });

    </script>

@endsection